package com.htc.android.footprints.backup;

import java.io.File;

import com.htc.android.footprints.utils.camera.FootprintImageManager;

public class FootprintRestoreService extends BackupRestoreService
{
  private static final String FILE_NAME = "footprints_backup.kmz";
  private static final String TAG = "FootprintRestoreService";
  private String filepath;

  // ERROR //
  public void convertData(String paramString1, String paramString2, String paramString3)
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 26	com/htc/android/footprints/backup/FootprintRestoreService:mVersion	Ljava/lang/String;
    //   4: invokestatic 32	com/htc/util/backup/Version:parse	(Ljava/lang/String;)Lcom/htc/util/backup/Version;
    //   7: astore 4
    //   9: aload_2
    //   10: invokestatic 32	com/htc/util/backup/Version:parse	(Ljava/lang/String;)Lcom/htc/util/backup/Version;
    //   13: astore 5
    //   15: aload_3
    //   16: iconst_1
    //   17: aload_3
    //   18: getstatic 37	java/io/File:separator	Ljava/lang/String;
    //   21: invokevirtual 43	java/lang/String:lastIndexOf	(Ljava/lang/String;)I
    //   24: iadd
    //   25: invokevirtual 47	java/lang/String:substring	(I)Ljava/lang/String;
    //   28: invokevirtual 51	java/lang/String:toLowerCase	()Ljava/lang/String;
    //   31: ldc 9
    //   33: invokevirtual 55	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   36: ifeq +94 -> 130
    //   39: aload 5
    //   41: aload 4
    //   43: invokevirtual 59	com/htc/util/backup/Version:lessEqualThan	(Lcom/htc/util/backup/Version;)Z
    //   46: ifeq +84 -> 130
    //   49: aconst_null
    //   50: astore 6
    //   52: new 61	java/io/FileInputStream
    //   55: dup
    //   56: aload_3
    //   57: invokespecial 64	java/io/FileInputStream:<init>	(Ljava/lang/String;)V
    //   60: astore 7
    //   62: aload_0
    //   63: invokevirtual 68	com/htc/android/footprints/backup/FootprintRestoreService:getApplicationContext	()Landroid/content/Context;
    //   66: invokestatic 74	com/htc/android/footprints/provider/FootprintManager:getInstance	(Landroid/content/Context;)Lcom/htc/android/footprints/provider/FootprintManager;
    //   69: invokevirtual 77	com/htc/android/footprints/provider/FootprintManager:removeAllFootprint	()V
    //   72: aload 7
    //   74: invokestatic 83	com/htc/android/footprints/kml/KMLUtil:importKMZ	(Ljava/io/InputStream;)[Lcom/htc/android/footprints/vo/Footprint;
    //   77: astore 13
    //   79: aload 13
    //   81: arraylength
    //   82: istore 14
    //   84: iconst_0
    //   85: istore 15
    //   87: iload 15
    //   89: iload 14
    //   91: if_icmpge +29 -> 120
    //   94: aload 13
    //   96: iload 15
    //   98: aaload
    //   99: astore 18
    //   101: aload_0
    //   102: invokevirtual 68	com/htc/android/footprints/backup/FootprintRestoreService:getApplicationContext	()Landroid/content/Context;
    //   105: invokestatic 74	com/htc/android/footprints/provider/FootprintManager:getInstance	(Landroid/content/Context;)Lcom/htc/android/footprints/provider/FootprintManager;
    //   108: aload 18
    //   110: invokevirtual 87	com/htc/android/footprints/provider/FootprintManager:addFootprint	(Lcom/htc/android/footprints/vo/Footprint;)I
    //   113: pop
    //   114: iinc 15 1
    //   117: goto -30 -> 87
    //   120: aload 7
    //   122: ifnull +8 -> 130
    //   125: aload 7
    //   127: invokevirtual 90	java/io/FileInputStream:close	()V
    //   130: return
    //   131: astore 16
    //   133: ldc 12
    //   135: aload 16
    //   137: invokevirtual 93	java/io/IOException:getMessage	()Ljava/lang/String;
    //   140: aload 16
    //   142: invokestatic 99	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   145: pop
    //   146: goto -16 -> 130
    //   149: astore 20
    //   151: aload 20
    //   153: astore 9
    //   155: new 101	java/lang/RuntimeException
    //   158: dup
    //   159: aload 9
    //   161: invokespecial 104	java/lang/RuntimeException:<init>	(Ljava/lang/Throwable;)V
    //   164: athrow
    //   165: astore 10
    //   167: aload 6
    //   169: ifnull +8 -> 177
    //   172: aload 6
    //   174: invokevirtual 90	java/io/FileInputStream:close	()V
    //   177: aload 10
    //   179: athrow
    //   180: astore 11
    //   182: ldc 12
    //   184: aload 11
    //   186: invokevirtual 93	java/io/IOException:getMessage	()Ljava/lang/String;
    //   189: aload 11
    //   191: invokestatic 99	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   194: pop
    //   195: goto -18 -> 177
    //   198: astore 10
    //   200: aload 7
    //   202: astore 6
    //   204: goto -37 -> 167
    //   207: astore 8
    //   209: aload 8
    //   211: astore 9
    //   213: aload 7
    //   215: astore 6
    //   217: goto -62 -> 155
    //
    // Exception table:
    //   from	to	target	type
    //   125	130	131	java/io/IOException
    //   52	62	149	java/lang/Exception
    //   52	62	165	finally
    //   155	165	165	finally
    //   172	177	180	java/io/IOException
    //   62	114	198	finally
    //   62	114	207	java/lang/Exception
  }

  public BackupRestoreService.ActionType determineAction(String paramString1, String paramString2, String paramString3)
    throws Exception
  {
    String str = paramString3.substring(1 + paramString3.lastIndexOf(File.separator));
    if ((FootprintImageManager.hasStorage(true)) && (str.toLowerCase().equals("footprints_backup.kmz")));
    for (BackupRestoreService.ActionType localActionType = BackupRestoreService.ActionType.CONVERT; ; localActionType = BackupRestoreService.ActionType.SKIP)
      return localActionType;
  }

  // ERROR //
  public void initBackup()
  {
    // Byte code:
    //   0: iconst_1
    //   1: invokestatic 112	com/htc/android/footprints/utils/camera/FootprintImageManager:hasStorage	(Z)Z
    //   4: ifeq +128 -> 132
    //   7: aload_0
    //   8: new 124	java/lang/StringBuilder
    //   11: dup
    //   12: invokespecial 125	java/lang/StringBuilder:<init>	()V
    //   15: aload_0
    //   16: invokevirtual 129	com/htc/android/footprints/backup/FootprintRestoreService:getCacheDir	()Ljava/io/File;
    //   19: invokevirtual 132	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   22: invokevirtual 136	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   25: getstatic 37	java/io/File:separator	Ljava/lang/String;
    //   28: invokevirtual 136	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   31: ldc 9
    //   33: invokevirtual 136	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   36: invokevirtual 139	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   39: putfield 141	com/htc/android/footprints/backup/FootprintRestoreService:filepath	Ljava/lang/String;
    //   42: aconst_null
    //   43: astore_1
    //   44: new 143	java/io/FileOutputStream
    //   47: dup
    //   48: aload_0
    //   49: getfield 141	com/htc/android/footprints/backup/FootprintRestoreService:filepath	Ljava/lang/String;
    //   52: invokespecial 144	java/io/FileOutputStream:<init>	(Ljava/lang/String;)V
    //   55: astore_2
    //   56: aload_0
    //   57: invokevirtual 68	com/htc/android/footprints/backup/FootprintRestoreService:getApplicationContext	()Landroid/content/Context;
    //   60: invokestatic 74	com/htc/android/footprints/provider/FootprintManager:getInstance	(Landroid/content/Context;)Lcom/htc/android/footprints/provider/FootprintManager;
    //   63: ldc 146
    //   65: invokevirtual 150	com/htc/android/footprints/provider/FootprintManager:getFootprintAll	(Ljava/lang/String;)Ljava/util/ArrayList;
    //   68: astore 8
    //   70: aload 8
    //   72: aload 8
    //   74: invokevirtual 156	java/util/ArrayList:size	()I
    //   77: anewarray 158	com/htc/android/footprints/vo/Footprint
    //   80: invokevirtual 162	java/util/ArrayList:toArray	([Ljava/lang/Object;)[Ljava/lang/Object;
    //   83: checkcast 164	[Lcom/htc/android/footprints/vo/Footprint;
    //   86: aload_2
    //   87: invokestatic 168	com/htc/android/footprints/kml/KMLUtil:exportKMZ	([Lcom/htc/android/footprints/vo/Footprint;Ljava/io/OutputStream;)V
    //   90: aload_2
    //   91: invokevirtual 171	java/io/FileOutputStream:flush	()V
    //   94: aload_0
    //   95: new 124	java/lang/StringBuilder
    //   98: dup
    //   99: invokespecial 125	java/lang/StringBuilder:<init>	()V
    //   102: aload_0
    //   103: invokevirtual 129	com/htc/android/footprints/backup/FootprintRestoreService:getCacheDir	()Ljava/io/File;
    //   106: invokevirtual 132	java/io/File:getAbsolutePath	()Ljava/lang/String;
    //   109: invokevirtual 136	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   112: getstatic 37	java/io/File:separator	Ljava/lang/String;
    //   115: invokevirtual 136	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   118: invokevirtual 139	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   121: invokevirtual 174	com/htc/android/footprints/backup/FootprintRestoreService:addExtraFolder	(Ljava/lang/String;)V
    //   124: aload_2
    //   125: ifnull +7 -> 132
    //   128: aload_2
    //   129: invokevirtual 175	java/io/FileOutputStream:close	()V
    //   132: return
    //   133: astore 9
    //   135: ldc 12
    //   137: aload 9
    //   139: invokevirtual 93	java/io/IOException:getMessage	()Ljava/lang/String;
    //   142: aload 9
    //   144: invokestatic 99	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   147: pop
    //   148: goto -16 -> 132
    //   151: astore 11
    //   153: aload 11
    //   155: astore 4
    //   157: new 101	java/lang/RuntimeException
    //   160: dup
    //   161: aload 4
    //   163: invokespecial 104	java/lang/RuntimeException:<init>	(Ljava/lang/Throwable;)V
    //   166: athrow
    //   167: astore 5
    //   169: aload_1
    //   170: ifnull +7 -> 177
    //   173: aload_1
    //   174: invokevirtual 175	java/io/FileOutputStream:close	()V
    //   177: aload 5
    //   179: athrow
    //   180: astore 6
    //   182: ldc 12
    //   184: aload 6
    //   186: invokevirtual 93	java/io/IOException:getMessage	()Ljava/lang/String;
    //   189: aload 6
    //   191: invokestatic 99	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   194: pop
    //   195: goto -18 -> 177
    //   198: astore 5
    //   200: aload_2
    //   201: astore_1
    //   202: goto -33 -> 169
    //   205: astore_3
    //   206: aload_3
    //   207: astore 4
    //   209: aload_2
    //   210: astore_1
    //   211: goto -54 -> 157
    //
    // Exception table:
    //   from	to	target	type
    //   128	132	133	java/io/IOException
    //   44	56	151	java/lang/Exception
    //   44	56	167	finally
    //   157	167	167	finally
    //   173	177	180	java/io/IOException
    //   56	124	198	finally
    //   56	124	205	java/lang/Exception
  }
}

/* Location:           E:\workspace\dex2java\dex-translator-0.0.9.3\HtcFootprints_dex2jar.jar
 * Qualified Name:     com.htc.android.footprints.backup.FootprintRestoreService
 * JD-Core Version:    0.6.0
 */